package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.BeanPool;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @Author: ps
 * @Date: 2019/9/16 0016 下午 1:37
 */
@Repository
public class BeanPoolDao {
    @Autowired
    private SqlSession sqlSession;

    public BeanPool getBeanPool(BeanPool beanPool){
        return sqlSession.selectOne("getBeanPool",beanPool);
    }

    public int updateBeanPoolBeans(BeanPool beanPool){
        return sqlSession.update("updateBeanPoolBeans",beanPool);
    }

    public int updateBeanPoolState(BeanPool beanPool){
        return sqlSession.update("updateBeanPoolState",beanPool);
    }

    public int addBeanPool(BeanPool beanPool) {
       return sqlSession.insert("addBeanPool",beanPool);
    }
}
